home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Interactive 7
/
PC World Interactive 7.iso
/
program
/
pasprog.EXE
/
PRNCHK.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-05-12
|
635b
|
29 lines
function prnstat(lpt:word):string;
var
result :byte;
tmps:string;
begin
asm
mov ah,02
mov dx,lpt
int 17h
mov result,ah
end;
tmps:='';
if (result and 1)<>0 then tmps:=tmps+' timeout';
if (result and 8)<>0 then tmps:=tmps+' TXerror';
if (result and 16)<>0 then tmps:=tmps+' Online';
if (result and 32)<>0 then tmps:=tmps+' OutOfPaper';
if (result and 64)<>0 then tmps:=tmps+' Exists';
if (result and 128)=0 then tmps:=tmps+' Busy';
prnstat:=tmps;
end;
begin
writeln('LPT1 = ',prnstat(0));
writeln('LPT2 = ',prnstat(1));
writeln('LPT3 = ',prnstat(2));
writeln('LPT4 = ',prnstat(3));
end.